/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __LoginScene_H__
#define __LoginScene_H__

#include "SceneObject.h"

namespace PQClient
{
	class LoginSuccessEvent
		: public Event
	{
	};

	class LoginScene
		: public SceneObject
	{
	public:
		//Login Status
		enum LoginStatus
		{
			Login_Debug_Setting,
			Login_Select_Server,//
			Login_Disconnect,//
			Login_Connecting,
			Login_Connect_OK,
			Login_Connect_Fail,//Fail to connect to the server

			Login_Account_Begin_Requesting,//the status that before send the password to the server
			Login_Account_Requesting,//Sending account packet to the server
			Login_Account_OK,//Success to check the account
			Login_Account_Failed,//Fail to check the account

			Login_Waiting_For_Login,//wait in queue for enter game
			Login_First_Login,
			Login_Change_Scene,//change scene to relogin


			//Add new login stauts just before this line...
			Login_Status_Unkown
		};

	public:
		LoginScene(Ogre::RenderWindow* win);

		/*Load the login scene.
		*/
		void loadScene();

		void update(float deltaT);

		inline void setStatus(LoginStatus status)
		{
			_status=status;
		}

	protected:
		/*Load login config,including server info.*/
		void loadConfig();

	protected:
		LoginStatus _status;

		bool _relogin;//

		//Server information
		// Login server IP and Port
		int8 _serverAddr[64];
		int32 _serverPort;

		int _areaId;//selected area id(area in whole world map,continent?)
		int _serverId;//login server id

	};
}
#endif
